package JitTest;

import commander.CLI;
import core.*;
import gitobject.Commit;
import org.junit.Test;

public class test8_JitReset {
    @Test
    public void test() throws Exception {
        // 初始化仓库
        String[] sInit1 = {"jit","init","C:\\Users\\Alphamxy\\Desktop\\test"};
        CLI.jitInit(sInit1);

        System.out.println("=============== commit_1 ===============");
        // deep/ep1/1.txt
        JitAdd.add("deep");
        JitCommit.commit("First Time");
        String commit_1 = Commit.getLastCommit();

        System.out.println("=============== commit_2 ===============");
        JitAdd.add("TestDir");
        JitCommit.commit("Second Time");
        String commit_2 = Commit.getLastCommit();

        System.out.println("=============== commit_3 ===============");
        JitAdd.add("3.txt");
        JitCommit.commit("Third Time");
        String commit_3 = Commit.getLastCommit();

        System.out.println("=============== commit_4 ===============");
        JitAdd.add("4.txt");
        JitCommit.commit("Fourth Time");
        String commit_4 = Commit.getLastCommit();

        System.out.println("=============== commit_5 ===============");
        JitAdd.add("5.txt");
        JitCommit.commit("Fifth Time");
        String commit_5 = Commit.getLastCommit();

//        JitReset.reset("--soft",commit_4);
//        JitLogs.printLogs(Commit.deserialize(Commit.getLastCommit()));

//        JitReset.reset("--mixed",commit_3);
//        JitLogs.printLogs(Commit.deserialize(Commit.getLastCommit()));

        JitReset.reset("--hard",commit_3);
        JitLogs.printLogs();
    }
}
